class Solution {
public:
    int numberOfSteps(int num) {
        if(num==0){return 0;}
        if(1&num)
        {
           return 1+numberOfSteps(num-1);
        }
        else{
            return 1+numberOfSteps(num/2);
        }
    }
};